<template>
  <div>购物车</div>
</template>

<script>
import Vue from "vue"
export default {
  data() {
    return {};
  },
  // BeforeRouteEnter
  beforeRouteEnter(to, from, next) {
    let token = localStorage.getItem("token");
    if (token) {
      next();
    } else {
      Vue.prototype.$toast.success("请先登录");
      setTimeout(() => {
        next("/user");
      }, 1000);
    }
  },
};
</script>
 
<style lang = "less" scoped>
</style>